@if (fields) {
  <div class="search-sidebar my-10 sticky top-[40px]">
    <div class="sidebar-header flex justify-between items-center">
      <div class="key m-3">
        <mat-chip-listbox>
          @if (model.title) {
            <mat-chip-option color="primary" selected>{{ model.title }} </mat-chip-option>
          }
          @if (model.keys) {
            <mat-chip-option color="primary" selected>{{ model.keys }} </mat-chip-option>
          }
        </mat-chip-listbox>
      </div>
      <div class="item m-3">
        <button mat-button (click)="clear()">
          <mat-icon>clear</mat-icon>{{ label.clear || '清空' }}
        </button>
      </div>
    </div>
    <mat-divider />
    <form [formGroup]="form">
      <mat-accordion>
        <mat-expansion-panel
          expanded="true"
          (opened)="panelOpenState = true"
          (closed)="panelOpenState = false"
        >
          <mat-expansion-panel-header>
            <mat-panel-title>
              <strong>{{ label.filter || '过滤条件' }}</strong>
            </mat-panel-title>
          </mat-expansion-panel-header>
          <app-formly
            [form]="form"
            [fields]="fields"
            [model]="model"
            (modelChange)="onModelChange($event)"
          />
        </mat-expansion-panel>
      </mat-accordion>
    </form>
  </div>
}
